<?php
class yayasan_applied extends base_model
{
	function __construct()
	{
		parent::__construct();
		$this->init("yayasan_applied","id_yayasanapplied","nama_jenisyayasan");						
	}	
	
	function get_by_yayasan_id($id)
	{
		$rec = $this->db->select("*")->from($this->table_name)->where("id_yayasan",$id)->get();
		if($rec->num_rows()>0)
        {
            return $rec->result();
        }
        return FALSE;		
	}

	/**
	* Mencari jumlah yayasan sejenis. Misal : sekolah gratis, masjid, madrasah
	*/
	function get_count_by_jenis_id($id)
	{
		$filter = array("id_jenisyayasan"=>$id);
		$rec = $this->get_count($filter);
		return $rec;
	}
}
?>